﻿using System;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Windows.Forms;


namespace TestGui
{
	public partial class Form1 : Form
	{
		private Int32 _sizeX, _sizeY;

		public Form1()
		{
			InitializeComponent();
			this.myGridField.GridSizeChanged += myGridField_GridSizeChanged;
		}

		private void myGridField_GridSizeChanged(object sender, EventArgs e) { MessageBox.Show(this._sizeX + " " + this._sizeY); }

		private void Form1_Load(object sender, EventArgs e) { }

		private void button1_Click(object sender, EventArgs e)
		{

			try { this._sizeX = Int32.Parse(textBoxX.Text); }
			catch (Exception) { this._sizeX = 20; }

			try { this._sizeY = Int32.Parse(textBoxY.Text); }
			catch (Exception) { this._sizeY = 20; }

			CreateGrid(this._sizeX, this._sizeY);
		}

		private void CreateGrid(int sizeX, int sizeY)
		{
			this.myGridField.GridSize = new Size(sizeX, sizeY);
		}

		private void buttonGreening_Click(object sender, EventArgs e)
		{

		}
	}
}
